package org.framework.edu.service.impl;

import org.framework.edu.service.JwtService;
import org.framework.edu.service.TokenService;

import javax.annotation.Resource;

public class JwtServiceImpl implements JwtService {
    @Resource
    private TokenService tokenService;
    @Override
    public String getUserIdByToken(String token) {
        return tokenService.parseToken(token).getBody().getId();
    }

    @Override
    public String getUsername(String token) {
        return tokenService.parseToken(token).getBody().getSubject();
    }
}
